﻿@using KRM.Core
@model KRM.Core.tblPromotion
@{
    var mindate = Model.EndDate == tblCompanyVariable.SqlMinDate;
}
<fieldset>
    <legend>Promotion Details</legend>
    <form action="/products/savepromotion" method="POST" id="fr-savepromotion" class="margin0">
        <input type="hidden" name="id" id="promotionId" value="@Model.ID"/>
        <div class="row-fluid">
            <div class="span2">Name</div>
            <div class="span4">
                <input type="text" class="input-block-level" name="name" value="@Model.Name"/>
            </div>
            <div class="span2">Folder Ref</div>
            <div class="span4">
                <input type="text" class="input-block-level" name="RefName" value="@Model.RefName"/>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span2">Start Date</div>
            <div class="span4">
                <div class="input-append datetimepicker">
                    <input data-format="dd/MM/yyyy HH:mm" type="text" name="startdate" style="width: 77%" value="@Model.StartDate.ToString("dd/MM/yyyy HH:mm")" />
                    <span class="add-on">
                        <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                    </span>
                </div>
            </div>
            <div class="span2">End Date</div>
            <div class="span4">
                <div class="row-fluid">
                    <div class="span1">
                        <input type="checkbox" name="checkenddate" @(mindate ? "" : "checked=checked") />
                    </div>
                <div class="span11">
                    <div class="input-append datetimepicker">
                        <input data-format="dd/MM/yyyy HH:mm" type="text" name="enddate" style="width: 74%" value="@Model.EndDate.ToString("dd/MM/yyyy HH:mm")" />
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>
                </div>
            </div>
        </div>
        <div class="row-fluid">
            Description
            <textarea name="description" class="input-block-level" maxlength="125" rows="3">@Model.Description</textarea>
        </div>
        <div class="row-fluid">
            Summary
            <textarea name="Summary" class="input-block-level">@Model.Summary</textarea>
        </div>
        <div class="row-fluid">
            <div class="span6">
                <label>
                    <input type="checkbox" class="cbcheck" name="active" @(Model.Active ? "checked=checked":"")/>
                    Active</label>
            </div>
            <div class="span6 text-right">
                <input type="submit" class="btn btn-primary w100" value="Save" />
            </div>
        </div>
    </form>
</fieldset>
